﻿using ModelLayer;
using System.Data.SqlClient;

namespace ControllerLayer
{
    internal interface IRouteCtr
    {
        /// <summary>
        /// Generates a route using Dijkstra's graph search algorithm.
        /// </summary>
        /// <param name="startStation">The start station.</param>
        /// <param name="endStation">The end station.</param>
        /// <returns>Route.</returns>
        Route GenerateRouteUsingDijkstras(Station startStation, Station endStation);

        /// <summary>
        /// Generates a route using A* graph search algorithm.
        /// </summary>
        /// <param name="startStation">The start station.</param>
        /// <param name="endStation">The end station.</param>
        /// <returns>Route.</returns>
        Route GenerateRouteUsingAStar(Station startStation, Station endStation);

        /// <summary>
        /// Creates a route in the database.
        /// </summary>
        /// <param name="route">The route.</param>
        /// <param name="con">the current connection</param>
        /// <param name="transaction">the current transaction</param>
        /// <returns>The number of affected rows</returns>
        int CreateRoute(Route route, SqlConnection con, SqlTransaction transaction);

        /// <summary>
        /// Gets a route from the database.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns>Route.</returns>
        Route GetRoute(long id);

        /// <summary>
        /// Removes a route from the database.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns>The number of affected rows</returns>
        int RemoveRoute(long id);
    }
}